import os


class Config:
    # 基础配置
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev'

    # 数据相关配置
    DATA_FOLDER = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data')
    UPLOAD_FOLDER = os.path.join(DATA_FOLDER, 'uploads')
    MODEL_FOLDER = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'models')

    # 确保必要的文件夹存在
    os.makedirs(DATA_FOLDER, exist_ok=True)
    os.makedirs(UPLOAD_FOLDER, exist_ok=True)
    os.makedirs(MODEL_FOLDER, exist_ok=True)

    # 允许上传的文件类型
    ALLOWED_EXTENSIONS = {'csv', 'xlsx', 'xls'}
